package com.xf.common.security.starter.properties;

import com.xf.common.core.entity.constant.EndpointConstant;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

/**
 * @author xufeng
 */
@ConfigurationProperties(prefix = "febs.cloud.security")
public class FebsCloudSecurityProperties {
    /**
     * 客户端id
     */
    private String clientId;

    /**
     * 组织id
     */
    private String organizationId;

    /**
     * 租户id
     */
    private String tenantId;
    /**
     * 是否开启安全配置
     */
    private Boolean enable;
    /**
     * jwt解密密钥
     */
    private String jwtAccessKey;
    /**
     * 配置需要认证的uri，默认为所有/**
     */
    private String authUri = EndpointConstant.ALL;

    public List<String> getAnonUris() {
        return anonUris;
    }

    public void setAnonUris(List<String> anonUris) {
        this.anonUris = anonUris;
    }

    /**
     * 免认证资源路径，支持通配符
     * 多个值时使用逗号分隔
     */
    private List<String> anonUris;
    /**
     * 授权服务器地址
     */
    private String authServerUrl;

    public String getAuthServerUrl() {
        return authServerUrl;
    }

    public void setAuthServerUrl(String authServerUrl) {
        this.authServerUrl = authServerUrl;
    }

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public String getAuthUri() {
        return authUri;
    }

    public void setAuthUri(String authUri) {
        this.authUri = authUri;
    }

    public String getOrganizationId() {
        return organizationId;
    }

    public void setOrganizationId(String organizationId) {
        this.organizationId = organizationId;
    }

    public String getJwtAccessKey() {
        return jwtAccessKey;
    }

    public void setJwtAccessKey(String jwtAccessKey) {
        this.jwtAccessKey = jwtAccessKey;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    @Override
    public String toString() {
        return "FebsCloudSecurityProperties{" +
                "enable=" + enable +
                ", authUri='" + authUri + '\'' +
                ", anonUris='" + anonUris + '\'' +
                '}';
    }
}
